package com.bawei.module_mine.ui

import android.hardware.Camera
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.bawei.module_mine.R

class TestCameraActivity : AppCompatActivity() {
    private lateinit var camera: Camera
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_test_camera)
        try {
            camera = Camera.open()
            Toast.makeText(this, "摄像头打开成功！", Toast.LENGTH_SHORT).show()
            camera.release()
        } catch (e: Exception) {
            Toast.makeText(this, "摄像头打开失败：${e.message}", Toast.LENGTH_LONG).show()
        }
    }
}